<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="copyright" content="闻康集团刘代明监制" />
<meta name="robots" content="all" />
{$css_file}{$js_file}{$js_dialog}
<script type='text/javascript'>

     function addpush(id,type){
    	 $.dialog({
             title:'食谱推送',
			 fixed:true,
		     resize: false,
		     ok:true,
		     cancelVal: '取消',
		     cancel: true,
		     width:'100',
	    	 content:document.getElementById('artdialogcontent'),
	    	 ok:function(){
		    	 if (type == 1) {
		    		    var length = $("input[name='app[]']:checked").length;
		    		    if (length == 0) {
			    		    alert('没有选择推送app');
		    		        return false;
		    		    }
		    		    $("#fid").val(id);
		    		    $("#addFoodPush").submit();
		    	 }
	    	 }
    	 });
     }
</script>
</head>
<body>
<div class="main">
	<div class="crumbs">
	当前位置：<span id="current_pos">面板->疾病饮食管理->疾病食谱列表</span>
	</div>
    <div class="m_content" id="right_main">
        <div class="content_menu blue line-x">
            <a class="on" href="__GROUP__/Disassistant/addDisFood" ><em>添加食谱</em></a>
        </div>
        <div>
                <div class="table_list">
                <table width="100%" cellspacing="0">
                	<thead>
                		<tr>
                			<th align="left">序号</th>
                			<th align="left">食谱名称</th>
                			<th align="left">食谱图片</th>
                			<th align="left">类别</th>
                			<th align="left">营养</th>
                			<th align="left">更新时间</th>
                			<th align="left">添加者</th>
                			<th align="left">操作</th>
                		</tr>
                	</thead>
                    <tbody id="data">
                    <volist name="list" id="vo" empty="$empty">
                    <tr>
                    	<td align="left">{$vo.id}</td>
                    	<td align="left">{$vo.recipename}</td>
                    	<td align="left"><img src="{$vo.imgaddress}" alt="" width='150' height='80'/></td>
                    	<td align="left">{$type[$vo['type']]}</td>
                    	<td align="left">{$nutrition[$vo['nutrition']]}</td>
                    	<td align="left">{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                    	<td align="left">{$vo.adduser}</td>
                		<td align="left">
                			<a href="__GROUP__/Disassistant/editDisFood/id/{$vo.id}">[修改]</a> | 
                			<empty name='apps'>
                			<a href="javascript:void(0);" onclick="addpush({$vo.id},0);">[推送]</a>
                			<else/>
                			<a href="javascript:void(0);" onclick="addpush({$vo.id},1);">[推送]</a>
                			</empty>
                		</td>
                    </tr>
                    </volist>
					</tbody>
                </table>
			    <div class="page_number">{$page}</div>	
    		</div>
    		<div id='artdialogcontent' style='display:none;'>
                <form action="__GROUP__/Disassistant/addFoodPush" method="post" id="addFoodPush">
                <div class="estransfer">
                    <ul>
                        <volist name='apps' id='vo' empty="$empty">
                        <if condition="($i-1)%6 eq 0">
                        <li>
                        </if>
                        <input class='app' type='checkbox' name='app[]' value='{$vo.id}'/> {$vo.appname}
                        <if condition="($i-6)%6 eq 0">
                        </li>
                        </if>
                        </volist>
                    </ul>
                </div>
                <input id='fid' type='hidden' name='fid' value='' />
                </form>
            </div>
		</div>
    </div>
</div>
</body>
</html>